package com.topcoder.srm516;

public class NetworkXZeroOne {
	public String reconstruct(String message) {
		for (int i=0; i<message.length(); i++) {
			if (message.charAt(i) == 'o') return reconstruct(i%2, message.length());
			if (message.charAt(i) == 'x') return reconstruct((i+1)%2, message.length());
		}
		return message;
	}
	
	private String reconstruct(int start, int length) {
		StringBuilder sb = new StringBuilder();
		for (int i=0; i<length; i++) {
			sb.append(start==0? 'o' : 'x');
			start = 1 - start;
		}
		return sb.toString();
	}
}
